home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_force_well.cog < prev    next >
Text File  |  1998-02-25  |  1KB  |  68 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # FORCE_WELL.COG
  4. #
  5. # JEDI RANK Script
  6. #  Bin 20
  7. #
  8. #  The rank of a Jedi determines his mana regeneration rate.
  9. #
  10. # [YB]
  11. #
  12. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  13.  
  14.  
  15. symbols
  16.  
  17. thing       player                           local
  18.  
  19. message     startup
  20. message     pulse
  21.  
  22. flex            maximum
  23.  
  24. end
  25.  
  26. # ========================================================================================
  27.  
  28. code
  29.  
  30. startup:
  31.    player = GetLocalPlayerThing();
  32.    
  33.     // determine the maximum
  34.    maximum = GetInv(player, 20) * 50;
  35.     if (IsMulti())
  36.     {
  37.         if (maximum < jkGetMultiParam(120))
  38.             maximum = jkGetMultiParam(120);
  39.         SetInv(player, 69, maximum);
  40.     }
  41.     else
  42.         SetInv(player, 69, 1000000);
  43.  
  44.     Sleep(1.0);
  45.    SetPulse(1.0);
  46.  
  47.    Return;
  48.  
  49. # ........................................................................................
  50.  
  51. pulse:
  52.    // don't do anything if the player is currently dead
  53.    if(GetThingHealth(player) < 1) Return;
  54.  
  55.     if (!IsMulti())
  56.       maximum = GetInv(player, 20) * 50;
  57.    
  58.     ChangeInv(player, 14, maximum / 100);
  59.  
  60.    if(GetInv(player, 14) > maximum)
  61.       SetInv(player, 14, maximum);
  62.  
  63.    Return;
  64.  
  65. end
  66.  
  67.  
  68.